﻿using UnityEngine;
using UnityEngine.UI;

namespace BToolkit.ExeUtils
{
    [RequireComponent(typeof(DragUGUI))]
    [RequireComponent(typeof(VerticalLayoutGroup))]
    public class EditDialog : MonoBehaviour
    {
        private void OnDestroy()
        {
            MainController.onEditModeEnable -= OnEditModeEnable;
        }

        void Awake()
        {
            MainController.onEditModeEnable += OnEditModeEnable;
        }

        private void Start()
        {
            gameObject.SetActive(false);
        }

        private void OnEditModeEnable(bool isEditMode, bool canSave)
        {
            gameObject.SetActive(isEditMode);
        }

    }
}